<!DOCTYPE html>
<html lang="en">
    <head>
        {% block head %}
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <!—[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
            <![endif]—>
            {% block stylesheets %}
                <link type="text/css" rel="stylesheet" href="{{ base_url() }}css/bootstrap.css">
                <link type="text/css" rel="stylesheet" href="{{ base_url() }}css/bootstrap-theme.min.css">
                <link type="text/css" rel="stylesheet" href="{{ base_url() }}css/base/base.css">
            {% endblock %}
            <title>{% block title %}{{ title }}{% endblock %}</title>
            {% block javascripts %}
                <script src="{{ base_url() }}js/jquery-1.11.1.min.js"></script>
                <script src="{{ base_url() }}js/bootstrap.min.js"></script>
            {% endblock %}
        {% endblock %}
    </head>
    <body>
        {% block header %}
            <header>
                <nav>
                    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
                        <div class="container-fluid">
                            <!-- Brand and toggle get grouped for better mobile display -->
                            <div class="navbar-header">
                                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                                    <span class="sr-only">Toggle navigation</span>
                                    <span class="icon-bar"></span>
                                    <span class="icon-bar"></span>
                                    <span class="icon-bar"></span>
                                </button>
                                <a class="navbar-brand" href={{ base_url('home') }}>Canchas</a>
                            </div>

                            <!-- Collect the nav links, forms, and other content for toggling -->
                            <div class="navbar-collapse collapse">
                                <ul class="nav navbar-nav">
                                    <li class="active"><a href={{ base_url('home') }}>Home</a></li>
                                    <li><a href={{ base_url('complejo/listar') }}>Complejos</a></li>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Acerca de <span class="caret"></span></a>
                                        <ul class="dropdown-menu" role="menu">
                                            <li><a href={{ base_url('home') }}>Reservar una cancha</a></li>
                                            <li><a href={{ base_url('home') }}>Sumar tu complejo</a></li>
                                            <li><a href={{ base_url('home') }}>Nosotros</a></li>
                                            <li class="divider"></li>
                                            <li><a href={{ base_url('home') }}>Política de privacidad</a></li>
                                        </ul>
                                    </li>
                                </ul>                         
                                <ul class="nav navbar-nav navbar-right">
                                    {% if is_login %}
                                        <li><a href={{ base_url('auth/control_panel') }} ><span class="glyphicon glyphicon-cog"></span> Panel de Control</a></li>
                                        <li class="dropdown">
                                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ user.email }}<span class="caret"></span></a>
                                            <ul class="dropdown-menu" role="menu">
                                                <li><a href="#">Configuración</a></li>
                                                <li><a href="#">Ayuda</a></li>
                                                <li class="divider"></li>
                                                <li><a href={{ base_url('auth/logout') }}><i class="icon-user"></i>Cerrar sesión</a></li>
                                            </ul>
                                        </li>
                                    {% else %}    
                                        <li><a href={{ base_url('login') }}>Login</a></li>
                                    {% endif %}
                                </ul>
                            </div><!-- /.navbar-collapse -->
                        </div>
                    </div>
                </nav>
            </header>
        {% endblock %}
        <div class="container-fluid">
            <div class="row">
                {% block body %}{% endblock %}
            </div>
        </div>
        <footer class="footer">
            <div class="container">
                {% block footer %}
                    <p class="text-muted">Place sticky footer content here.</p>
                {% endblock %}
            </div>
        </footer>
</body>
</html>